Class Database

java.lang.Object
edu.uky.ai.ml.nn.Database
All Implemented Interfaces:
java.lang.Iterable<Example>
Direct Known Subclasses:
AlphabetDatabase

public class Database
extends java.lang.Object
implements java.lang.Iterable<Example>
A database is simply a collection of training examples on which a neural network can be trained.
Author:
Stephen G. Ware
  • Constructor Summary

    Constructors 
    Constructor Description
    Database()  
  • Method Summary

    Modifier and Type Method Description
    void addExample​(double[] input, double[] output, java.lang.String label)
    Adds a new example to the database.
    java.util.Iterator<Example> iterator()  
    int size()
    Returns the number of examples in this database.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

  • Method Details

    • size

      public int size()
      Returns the number of examples in this database.
      Returns:
      the numbers of examples
    • addExample

      public void addExample​(double[] input, double[] output, java.lang.String label)
      Adds a new example to the database.
      Parameters:
      input - the values to assign to the input neurons
      output - the expected values of the output neurons
      label - the class label associated with this example
    • iterator

      public java.util.Iterator<Example> iterator()
      Specified by:
      iterator in interface java.lang.Iterable<Example>